package com.bw.unit3.http

import com.bw.unit3.base.BaseBean
import com.bw.unit3.bean.BannerBean
import com.bw.unit3.bean.CartBean
import com.bw.unit3.bean.GoodsBean
import com.bw.unit3.bean.GoodsDetailBean
import com.bw.unit3.bean.LoginBean
import com.bw.unit3.bean.TypeBean
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 *
 * @ClassName: ApiService
 * @Description: java类作用描述
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/13 11:13 AM
 * @Version: 1.0
 */
interface ApiService {

    @POST("/user/loginjson")
    suspend fun loginjson(@Body map: Map<String, String>): BaseBean<LoginBean>

    @POST("/user/register")
    suspend fun register(@Body map: Map<String, String>): BaseBean<LoginBean>

    @GET("/banner/json")
    suspend fun getBanner(): BaseBean<List<BannerBean>>

    @GET("/goods/info")
    suspend fun getGoodsList(
        @Query("category_id") category_id: Int,
        @Query("currentPage") currentPage: Int,
        @Query("pageSize") pageSize: Int
    ): BaseBean<List<GoodsBean>>

    @GET("/goods/detail")
    suspend fun getGoodsDetail(@Query("goods_id") goods_id:Int): BaseBean<GoodsDetailBean>

    @GET("/goods/category")
    suspend fun getTypeGoods(): BaseBean<List<TypeBean>>

    @POST("/goods/addCar")
    suspend fun addCart(@Body map: Map<String, String>):BaseBean<String>
    @GET("/goods/selectCar")
    suspend fun getCarts():BaseBean<List<CartBean>>


}